/*# Capture ESXi system information.
#
# Written by: Alaa Hleihel <alaa@mellanox.com>
*/

#ifndef _methods_h_
#define _methods_h_

#include "CommandList.h"
#include "vars.h"

using namespace std;

//----------------------------------------------------------------------------------------
pid_t execCommand(char **command, int *infp, int *outfp, int *errfp);
string runCommand(char **command);
CommandList splitCommandByPipe(string cmd);
void sys_err(string s);
char *strToCharArr(const std::string & str);
vector <string> strSplit(string str, char delimiter);
int finalizeHtml(ofstream & file);
int initHtml(ofstream& file);
string commandToString(char ** cmdWithArgs);
string strReplace(string str, char a, char b);
void addIndexTable(ofstream & file, string title, CommandList cmdList);
void addElement(ofstream & file, string title, string content, string prev, string next);
void addCommandList(ofstream & file, CommandList cmdList);
void addFileList(ofstream & file, CommandList fileList);
string readFile(string path);

//----------------------------------------------------------------------------------------

#endif
